import axiosIns from "@/utils/request";

// type 取值:

// -1:全部
// 1:男歌手
// 2:女歌手
// 3:乐队

// area 取值:

// -1:全部
// 7华语
// 96欧美
// 8:日本
// 16韩国
// 0:其他
export interface ArtistListApiParams {
	limit?: number;
	offset?: number;
	initial?: string;
	type?: number;
	area?: number;
}
export const getArtistListApi = (
	params: ArtistListApiParams = {
		limit: 30,
		offset: 0,
		initial: "",
		type: -1,
		area: -1,
	}
) => {
	return axiosIns.get("/artist/list", { params });
};
export const getArtistsApi = (id) => {
	return axiosIns.get("/artists", { params: { id } });
};
export const getTop50Api = (id) => {
	return axiosIns.get("/artist/top/song", { params: { id } });
};
export const subArtistApi = ({ id, t }: { id: number | string; t?: number }) => {
	return axiosIns.get("/artist/sub", { params: { id, t: t === undefined ? 1 : t } });
};
export const getSubListApi = () => {
	return axiosIns.get("/artist/sublist");
};
export const getArtistAlbumApi = ({ id, limit = 10, offset = 0 }: { id: number | string; limit?: number; offset?: number }) => {
	return axiosIns.get("/artist/album", { params: { id, limit, offset } });
};
export const getArtistDetailApi = (id: string | number) => {
	return axiosIns.get("/artist/detail", { params: { id } });
};
export const getArtistDescApi = (id: string | number) => {
	return axiosIns.get("/artist/desc", { params: { id } });
};
export const getSimilarArtistApi = (id: string | number) => {
	return axiosIns.get("/simi/artist", { params: { id } });
};
